#include "DTOFlightControlerRequest.h"

DTOFlightControlerRequest::DTOFlightControlerRequest(std::string& aDeserealizar): DTO(FLIGHT_CONTROLER_REQUEST) {
	deserializar(aDeserealizar);
}

DTOFlightControlerRequest::DTOFlightControlerRequest(unsigned int controllerId) : DTO(FLIGHT_CONTROLER_REQUEST){
	this->controllerId = controllerId;
}

DTOFlightControlerRequest::~DTOFlightControlerRequest() {
}

std::string DTOFlightControlerRequest::serializar(){
	std::stringstream retorno;

	retorno << DTO::serializar();
	retorno << UtilString::intToString(this->controllerId);

	return (retorno.str());
}

void DTOFlightControlerRequest::deserializar(std::string& string){
	std::vector<std::string> valores;
	UtilString::splitWithSeparator(&valores,string,PLANO_SEPARATOR);

	this->controllerId = UtilString::stringToInt(valores[1]);
}

unsigned int DTOFlightControlerRequest::getControllerId(){
	return controllerId;
}

